package com.ouyeel.domain;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;

import java.io.Serializable;
import java.text.ParseException;
import java.util.Date;

/**
 * Created by SNK on 2016/9/2.
 */
public class RfqSupplierListNewVo implements Serializable {
    private static final long serialVersionUID = 1L;
    private String id ;//主键
    private String companyId ;//合格供应商代码
    private String supplierName ;//供应商名称
    private String linkmanName ;//联系人姓名
    private String linkmanTelphone ;//联系人电话
    private String supplierCode;	//供应商代码
    private String deviceDealerGrade;	//供应商等级
    private String type ;//所属类目




    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getSupplierCode() {
        return supplierCode;
    }

    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getLinkmanName() {
        return linkmanName;
    }

    public void setLinkmanName(String linkmanName) {
        this.linkmanName = linkmanName;
    }

    public String getLinkmanTelphone() {
        return linkmanTelphone;
    }

    public void setLinkmanTelphone(String linkmanTelphone) {
        this.linkmanTelphone = linkmanTelphone;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    public String getDeviceDealerGrade() {
        return deviceDealerGrade;
    }

    public void setDeviceDealerGrade(String deviceDealerGrade) {
        this.deviceDealerGrade = deviceDealerGrade;
    }




    private String dateFormat (String date){
        String result = "";
        if(StringUtils.isNotBlank(date)){
            Date newDate = null;
            try {
                newDate = DateUtils.parseDate(date, "yyyy-MM-dd HH:mm:ss.SSS");
            } catch (ParseException e) {
                try {
                    newDate = DateUtils.parseDate(date, "yyyy-MM-dd HH:mm:ss");
                } catch (ParseException e1) {
                    return result;
                }
            }
            result = DateFormatUtils.format(newDate,"yyyy-MM-dd HH:mm:ss");
        }else {
            result = "";
        }
        return result;
    }

}
